package com.chenchao.collection;

import java.util.Enumeration;
import java.util.Vector;

/**
 * @encoding : UTF-8
 * @Time : 2020/11/12 20:27
 * @Author : Chen Chao
 * @File : javaSE.com.chenchao.javacollection.VectorTest.java
 * @Software : IntelliJ IDEA
 * @since : 1.8
 * vector 1.2后并入list，用的不多
 * 操作一般 synchronized加锁
 */
public class VectorTest {
    public static void main(String[] args) {
        test();
    }
    public static void test(){
        Vector vector = new Vector();
        vector.add("gg");
        vector.addElement("gg1");
        Enumeration elements = vector.elements();
        //特有的遍历方法
        while (elements.hasMoreElements()){
            System.out.println(elements.nextElement());
        }

    }
}
